package com.fyk.service;

import com.fyk.dao.EmpDao;
import com.fyk.entity.Employee;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.util.StringUtils;

import java.util.List;

/**
 * @author 范宇坤
 * @date: 2021/8/4 14:23
 */
@Service
@Transactional
public class EmpServiceImpl implements EmpService{

    private static final Logger log = LoggerFactory.getLogger(EmpServiceImpl.class);
    private EmpDao empDao;
    @Autowired
    public void setEmpDao(EmpDao empDao) {
        this.empDao = empDao;
    }

    @Override
    public List<Employee> queryAllEmp() {
        return empDao.queryAllEmp();
    }

    @Override
    public void addEmp(Employee employee) {
        empDao.addEmp(employee);
    }

    @Override
    public void deleteEmpByName(String empNum) {
        empDao.deleteEmpByName(empNum);
    }

    @Override
    public Employee queryEmpByNum(String empNum) {
        return empDao.queryEmpByNum(empNum);
    }
}
